//
//  CNBaseNetworkConst.m
//  CNBaseNetworkFramework
//
//  Created by 邓建东 on 2020/6/17.
//  Copyright © 2020 CSDN. All rights reserved.
//

#import "CNBaseNetworkConst.h"

@implementation CNBaseNetworkConst
#pragma mark - 网络环境

+ (void)saveXCaStageType:(CNXCaStageType)xCaStageType
{
    NSUserDefaults *userdefault = [NSUserDefaults standardUserDefaults];
    [userdefault setInteger:xCaStageType forKey:@"xCaStageType"];
    [userdefault synchronize];
}

+ (CNXCaStageType)xCaStageType
{
    return [[NSUserDefaults standardUserDefaults] integerForKey:@"xCaStageType"];
}

+ (void)savePassPortHostType:(CNPassPortHostType)passPortHostType
{
    NSUserDefaults *userdefault = [NSUserDefaults standardUserDefaults];
    [userdefault setInteger:passPortHostType forKey:@"passPortHostType"];
    [userdefault synchronize];
}

+ (CNPassPortHostType)passPortHostType
{
    return [[NSUserDefaults standardUserDefaults] integerForKey:@"passPortHostType"];
}

+ (void)saveNotifyHostType:(CNNotifyHostType)notifyHostType
{
    NSUserDefaults *userdefault = [NSUserDefaults standardUserDefaults];
    [userdefault setInteger:notifyHostType forKey:@"notifyHostType"];
    [userdefault synchronize];
}

+ (CNNotifyHostType)notifyHostType
{
    return [[NSUserDefaults standardUserDefaults] integerForKey:@"notifyHostType"];
}

+ (void)saveWebAPPHostType:(CNWebAPPHostType)webAPPHostType
{
    NSUserDefaults *userdefault = [NSUserDefaults standardUserDefaults];
    [userdefault setInteger:webAPPHostType forKey:@"webAPPHostType"];
    [userdefault synchronize];
}

+ (CNWebAPPHostType)webAPPHostType
{
    return [[NSUserDefaults standardUserDefaults] integerForKey:@"webAPPHostType"];
}

+ (void)savePayHostType:(CNPayHostType)payHostType
{
    NSUserDefaults *userdefault = [NSUserDefaults standardUserDefaults];
    [userdefault setInteger:payHostType forKey:@"payHostType"];
    [userdefault synchronize];
}

+ (CNPayHostType)payHostType
{
    return [[NSUserDefaults standardUserDefaults] integerForKey:@"payHostType"];
}

+ (void)saveEduHostType:(CNEduHostType)eduHostType
{
    NSUserDefaults *userdefault = [NSUserDefaults standardUserDefaults];
    [userdefault setInteger:eduHostType forKey:@"eduHostType"];
    [userdefault synchronize];
}

+ (CNEduHostType)eduHostType
{
    return [[NSUserDefaults standardUserDefaults] integerForKey:@"eduHostType"];
}

+ (void)saveEditorHostType:(CNEditorHostType)editorHostType
{
    NSUserDefaults *userdefault = [NSUserDefaults standardUserDefaults];
    [userdefault setInteger:editorHostType forKey:@"editorHostType"];
    [userdefault synchronize];
}
+ (CNEditorHostType)editorHostType
{
    return [[NSUserDefaults standardUserDefaults] integerForKey:@"editorHostType"];
}

#pragma mark - 是否开启HTTPDNS
//默认开启 NO
+ (void)saveIsCloseHTTPDNS:(BOOL)isCloseHTTPDNS
{
    NSUserDefaults *userdefault = [NSUserDefaults standardUserDefaults];
    [userdefault setBool:isCloseHTTPDNS forKey:@"isCloseHTTPDNS"];
    [userdefault synchronize];
}

+ (BOOL)closeHTTPDNS
{
    return [[NSUserDefaults standardUserDefaults] boolForKey:@"isCloseHTTPDNS"];
}
@end
